<?php
/**
 * Created by PhpStorm.
 * User: 式神 (luck48.com)
 * Email: 289650682@qq.com
 * Name: ${NAME}Administrator
 * Date: 2017-03-28
 * Time: 15:13
 */

namespace App\Http\Models;

use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    protected $table='articles';
    protected $primaryKey="id";
    //public $timestamps=false;
    protected $fillable = [
        'title',
        'keywords',
        'author',
        'description',
        'content',
        'image',
        'comments_count',
        'click',
        'links',
        'type',
        'thumb',
        'tags',
        'del',
        'cid',
        'listsort',
        'copyfrom',
    ];

    /*
     * 定义逆向关系指向主键表
     * */
    public function Category(){
        return $this -> belongsTo(Category::class,'id');
    }
}